﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>jsTerminal - SMALL SITE, BIG-NEWs</title>
<link rel="icon" href="../favicon.ico" type="image/x-icon"/>

<link href="../res/jquery-ui-1.7.2.custom.css" rel="stylesheet" type="text/css" />
<!-- <link href="../res/common.css" rel="stylesheet" type="text/css" /> -->

<script type="text/javascript" src="../res/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="../res/jquery-ui-1.7.2.min.js"></script>

<script type='text/javascript' src='../dwr/interface/jsTerminalDwr.js'></script>
<script type='text/javascript' src='../dwr/engine.js'></script>


<style type="text/css">
<!--
body {
	margin: 0;
	padding: 0;
	font: 0.75em Tahoma, Geneva, sans-serif;
}
#results {
	font: 12px Fixedsys, Geneva, sans-serif;
	overflow: auto;
}
.result {
	margin: 0.5em;
	padding: 0.5em;
	background-color: #ffffe8;
}
.cmd {
	color: green;
}
#commands {
	margin: 1em;
	width: 80em;
	height: 10em;
	font: 12px Fixedsys, Geneva, sans-serif;
}
input[type=button] {
	margin: 1em 0.5em;
}
-->
</style>
<script type="text/javascript">

var cmd = '';
function submitCommand() {
	cmd = $.trim($('#commands').val());
	if(!cmd) return;
	$('#sub').attr('disabled', true).val('EXECUTING...');
	jsTerminalDwr.executeScript(cmd, function(sresult){
		var html = ['<div class="result"><div class="cmd">'];
		html.push(cmd, '</div><div>--------------------------------------------------------------------------------</div><div>', sresult.msg, '</div></div>');
		$('#results').append(html.join(''));
		$('#commands').val('');
		$('#sub').attr('disabled', false).val('EXECUTE');
	});
}
function lastCommand() {
	$('#commands').val(cmd);
}
function clear() {
	$('#results').empty();
}
</script>
</head>

<body>

	<div id="results">
	</div>
	
	<div>
	<textarea id="commands"></textarea>
	<input id="sub" type="button" onclick="submitCommand()" value="EXECUTE"/>
	<input type="button" onclick="lastCommand()" value="LAST CMD"/>
	<input type="button" onclick="clear()" value="CLEAR"/>
	</div>
</body>
</html>
